<template>
	<view class="quan"style="background-size: 100% 100%; background-image:url(https://fangu.xieenguoji.com/public/beijingtu.png)">
		<view class="tu">
			<image class="img" :src="$util.img(code)" />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code: '',
				member_id: ''
			}
		},
		onLoad(e) {
			this.member_id = e.id
			this.getcode()
		},
		methods: {
			getcode() {
				this.$api.sendRequest({
					url: '/api/member/getMyCommissionCode22',
					data: {
						member_id: this.member_id
					},
					success: res => {
						this.code = res.data
						console.log(res)
						// uni.showToast({
						// 	title:res.message,
						// 	icon:"none"
						// })
					}
				});
			},
			bc_code() {
				console.log(this.code)
				console.log("二维码路径", this.$util.img(this.code))
				let that = this;
				//console.log('保存二维码')
				uni.downloadFile({ //获得二维码的临时地址
					url: this.$util.img(this.code),
					success: (res) => {
						//console.log('获取url',res)
						if (res.statusCode == 200) {
							uni.saveImageToPhotosAlbum({
								filePath: res.tempFilePath, //传入临时地址
								success() {
									// that.$.ti_shi('保存成功')//封装的提示
								},
								fail() {
									// that.$.ti_shi('保存失败')
								}
							})
						}
					}
				})
			},
		}
	}
</script>

<style>
	.quan {
		width: 100%;
		height: 1100upx;
		/* border: #ffab58 solid 20upx; */
		border-radius: 20upx;
		box-sizing: border-box;
		}

	.title {
		width: 100%;
		height: 150upx;
		line-height: 150upx;
		font-weight: bold;
		font-size: 35upx;
		text-align: center;
	}

	.title1 {
		width: 100%;
		height: 150upx;
		line-height: 150upx;
		color: red;
		font-size: 35upx;
		text-align: center;
	}

	.tu {
		width: 400upx;
		height: 400upx;
		position: relative;
		top: 240upx;
		left: 180upx;
	}

	.img {
		width: 100%;
		height: 100%;
	}
</style>
